<?php
$sh_languages['flex'] = array(
    // State #0
    array(
        array(
            '/^%\{/i',
            'sh_preproc',
            1,
            1
        ),
        array(
            '/^%[sx]/i',
            'sh_preproc',
            16,
            1
        ),
        array(
            '/^%option/i',
            'sh_preproc',
            17,
            1
        ),
        array(
            '/^%(?:array|pointer|[aceknopr])/i',
            'sh_preproc',
            -1
        ),
        array(
            '/[a-z_][a-z0-9_-]*/i',
            'sh_preproc',
            19,
            1
        ),
        array(
            '/^%%/i',
            'sh_preproc',
            20,
            1
        )
    ),
    // State #1
    array(
        array(
            '/^%\}/i',
            'sh_preproc',
            -2
        ),
        array(
            '/(\b(?:class|struct|typename))([ \t]+)([a-z0-9_]+)/i',
            array('sh_keyword', 'sh_normal', 'sh_classname'),
            -1
        ),
        array(
            '/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\/\/\//i',
            'sh_comment',
            2
        ),
        array(
            '/\/\//i',
            'sh_comment',
            8
        ),
        array(
            '/\/\*\*/i',
            'sh_comment',
            9
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            10
        ),
        array(
            '/(\bstruct)([ \t]+)([a-z0-9_]+)/i',
            array('sh_keyword', 'sh_normal', 'sh_classname'),
            -1
        ),
        array(
            '/^[ \t]*#(?:[ \t]*include)/i',
            'sh_preproc',
            11,
            1
        ),
        array(
            '/^[ \t]*#(?:[ \t]*[a-z0-9_]*)/i',
            'sh_preproc',
            -1
        ),
        array(
            '/\b[+-]?(?:(?:0x[a-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/i',
            'sh_number',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            14
        ),
        array(
            '/\'/i',
            'sh_string',
            15
        ),
        array(
            '/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/i',
            'sh_type',
            -1
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        ),
        array(
            '/\{|\}/i',
            'sh_cbracket',
            -1
        ),
        array(
            '/(?:[a-z]|_)[a-z0-9_]*(?=[ \t]*\()/i',
            'sh_function',
            -1
        ),
        array(
            '/([a-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[a-z][^`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\[\]]+))/i',
            array('sh_usertype', 'sh_usertype', 'sh_normal'),
            -1
        )
    ),
    // State #2
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/(?:<?)[a-z0-9_\.\/\-_~]+@[a-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[a-z0-9_]+:\/\/[a-z0-9_\.\/\-_~]+(?:>?)/i',
            'sh_url',
            -1
        ),
        array(
            '/<\?xml/i',
            'sh_preproc',
            3,
            1
        ),
        array(
            '/<!DOCTYPE/i',
            'sh_preproc',
            5,
            1
        ),
        array(
            '/<!--/i',
            'sh_comment',
            6
        ),
        array(
            '/<(?:\/)?[a-z](?:[a-z0-9_:.-]*)(?:\/)?>/i',
            'sh_keyword',
            -1
        ),
        array(
            '/<(?:\/)?[a-z](?:[a-z0-9_:.-]*)/i',
            'sh_keyword',
            7,
            1
        ),
        array(
            '/&(?:[a-z0-9]+);/i',
            'sh_preproc',
            -1
        ),
        array(
            '/<(?:\/)?[a-z][a-z0-9]*(?:\/)?>/i',
            'sh_keyword',
            -1
        ),
        array(
            '/<(?:\/)?[a-z][a-z0-9]*/i',
            'sh_keyword',
            7,
            1
        ),
        array(
            '/@[a-z]+/i',
            'sh_type',
            -1
        ),
        array(
            '/(?:TODO|FIXME|BUG)(?:[:]?)/i',
            'sh_todo',
            -1
        )
    ),
    // State #3
    array(
        array(
            '/\?>/i',
            'sh_preproc',
            -2
        ),
        array(
            '/([^=" \t>]+)([ \t]*)(=?)/i',
            array('sh_type', 'sh_normal', 'sh_symbol'),
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            4
        )
    ),
    // State #4
    array(
        array(
            '/\\\\(?:\\\\|")/i',
            null,
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            -2
        )
    ),
    // State #5
    array(
        array(
            '/>/i',
            'sh_preproc',
            -2
        ),
        array(
            '/([^=" \t>]+)([ \t]*)(=?)/i',
            array('sh_type', 'sh_normal', 'sh_symbol'),
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            4
        )
    ),
    // State #6
    array(
        array(
            '/-->/i',
            'sh_comment',
            -2
        ),
        array(
            '/<!--/i',
            'sh_comment',
            6
        )
    ),
    // State #7
    array(
        array(
            '/(?:\/)?>/i',
            'sh_keyword',
            -2
        ),
        array(
            '/([^=" \t>]+)([ \t]*)(=?)/i',
            array('sh_type', 'sh_normal', 'sh_symbol'),
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            4
        )
    ),
    // State #8
    array(
        array(
            '/$/i',
            null,
            -2
        )
    ),
    // State #9
    array(
        array(
            '/\*\//i',
            'sh_comment',
            -2
        ),
        array(
            '/(?:<?)[a-z0-9_\.\/\-_~]+@[a-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[a-z0-9_]+:\/\/[a-z0-9_\.\/\-_~]+(?:>?)/i',
            'sh_url',
            -1
        ),
        array(
            '/<\?xml/i',
            'sh_preproc',
            3,
            1
        ),
        array(
            '/<!DOCTYPE/i',
            'sh_preproc',
            5,
            1
        ),
        array(
            '/<!--/i',
            'sh_comment',
            6
        ),
        array(
            '/<(?:\/)?[a-z](?:[a-z0-9_:.-]*)(?:\/)?>/i',
            'sh_keyword',
            -1
        ),
        array(
            '/<(?:\/)?[a-z](?:[a-z0-9_:.-]*)/i',
            'sh_keyword',
            7,
            1
        ),
        array(
            '/&(?:[a-z0-9]+);/i',
            'sh_preproc',
            -1
        ),
        array(
            '/<(?:\/)?[a-z][a-z0-9]*(?:\/)?>/i',
            'sh_keyword',
            -1
        ),
        array(
            '/<(?:\/)?[a-z][a-z0-9]*/i',
            'sh_keyword',
            7,
            1
        ),
        array(
            '/@[a-z]+/i',
            'sh_type',
            -1
        ),
        array(
            '/(?:TODO|FIXME|BUG)(?:[:]?)/i',
            'sh_todo',
            -1
        )
    ),
    // State #10
    array(
        array(
            '/\*\//i',
            'sh_comment',
            -2
        ),
        array(
            '/(?:<?)[a-z0-9_\.\/\-_~]+@[a-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[a-z0-9_]+:\/\/[a-z0-9_\.\/\-_~]+(?:>?)/i',
            'sh_url',
            -1
        ),
        array(
            '/(?:TODO|FIXME|BUG)(?:[:]?)/i',
            'sh_todo',
            -1
        )
    ),
    // State #11
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/</i',
            'sh_string',
            12
        ),
        array(
            '/"/i',
            'sh_string',
            13
        ),
        array(
            '/\/\/\//i',
            'sh_comment',
            2
        ),
        array(
            '/\/\//i',
            'sh_comment',
            8
        ),
        array(
            '/\/\*\*/i',
            'sh_comment',
            9
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            10
        )
    ),
    // State #12
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/>/i',
            'sh_string',
            -2
        )
    ),
    // State #13
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|")/i',
            null,
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            -2
        )
    ),
    // State #14
    array(
        array(
            '/"/i',
            'sh_string',
            -2
        ),
        array(
            '/\\\\./i',
            'sh_specialchar',
            -1
        )
    ),
    // State #15
    array(
        array(
            '/\'/i',
            'sh_string',
            -2
        ),
        array(
            '/\\\\./i',
            'sh_specialchar',
            -1
        )
    ),
    // State #16
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/[a-z_][a-z0-9_-]*/i',
            'sh_function',
            -1
        )
    ),
    // State #17
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/[a-z_][a-z0-9_-]*/i',
            'sh_keyword',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            18
        ),
        array(
            '/=/i',
            'sh_symbol',
            -1
        )
    ),
    // State #18
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/"/i',
            'sh_string',
            -2
        )
    ),
    // State #19
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\{[a-z_][a-z0-9_-]*\}/i',
            'sh_type',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            13
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        )
    ),
    // State #20
    array(
        array(
            '/^%%/i',
            'sh_preproc',
            21,
            1
        ),
        array(
            '/<[a-z_][a-z0-9_-]*>/i',
            'sh_function',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            13
        ),
        array(
            '/\\\\./i',
            'sh_preproc',
            -1
        ),
        array(
            '/\{[a-z_][a-z0-9_-]*\}/i',
            'sh_type',
            -1
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            22
        ),
        array(
            '/\{/i',
            'sh_cbracket',
            23,
            1
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        )
    ),
    // State #21
    array(
        array(
            '/(\b(?:class|struct|typename))([ \t]+)([a-z0-9_]+)/i',
            array('sh_keyword', 'sh_normal', 'sh_classname'),
            -1
        ),
        array(
            '/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\/\/\//i',
            'sh_comment',
            2
        ),
        array(
            '/\/\//i',
            'sh_comment',
            8
        ),
        array(
            '/\/\*\*/i',
            'sh_comment',
            9
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            10
        ),
        array(
            '/(\bstruct)([ \t]+)([a-z0-9_]+)/i',
            array('sh_keyword', 'sh_normal', 'sh_classname'),
            -1
        ),
        array(
            '/^[ \t]*#(?:[ \t]*include)/i',
            'sh_preproc',
            11,
            1
        ),
        array(
            '/^[ \t]*#(?:[ \t]*[a-z0-9_]*)/i',
            'sh_preproc',
            -1
        ),
        array(
            '/\b[+-]?(?:(?:0x[a-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/i',
            'sh_number',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            14
        ),
        array(
            '/\'/i',
            'sh_string',
            15
        ),
        array(
            '/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/i',
            'sh_type',
            -1
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        ),
        array(
            '/\{|\}/i',
            'sh_cbracket',
            -1
        ),
        array(
            '/(?:[a-z]|_)[a-z0-9_]*(?=[ \t]*\()/i',
            'sh_function',
            -1
        ),
        array(
            '/([a-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[a-z][^`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\[\]]+))/i',
            array('sh_usertype', 'sh_usertype', 'sh_normal'),
            -1
        )
    ),
    // State #22
    array(
        array(
            '/\*\//i',
            'sh_comment',
            -2
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            22
        )
    ),
    // State #23
    array(
        array(
            '/\}/i',
            'sh_cbracket',
            -2
        ),
        array(
            '/\{/i',
            'sh_cbracket',
            23,
            1
        ),
        array(
            '/\$./i',
            'sh_variable',
            -1
        ),
        array(
            '/(\b(?:class|struct|typename))([ \t]+)([a-z0-9_]+)/i',
            array('sh_keyword', 'sh_normal', 'sh_classname'),
            -1
        ),
        array(
            '/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\/\/\//i',
            'sh_comment',
            2
        ),
        array(
            '/\/\//i',
            'sh_comment',
            8
        ),
        array(
            '/\/\*\*/i',
            'sh_comment',
            9
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            10
        ),
        array(
            '/(\bstruct)([ \t]+)([a-z0-9_]+)/i',
            array('sh_keyword', 'sh_normal', 'sh_classname'),
            -1
        ),
        array(
            '/^[ \t]*#(?:[ \t]*include)/i',
            'sh_preproc',
            11,
            1
        ),
        array(
            '/^[ \t]*#(?:[ \t]*[a-z0-9_]*)/i',
            'sh_preproc',
            -1
        ),
        array(
            '/\b[+-]?(?:(?:0x[a-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/i',
            'sh_number',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            14
        ),
        array(
            '/\'/i',
            'sh_string',
            15
        ),
        array(
            '/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/i',
            'sh_type',
            -1
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        ),
        array(
            '/\{|\}/i',
            'sh_cbracket',
            -1
        ),
        array(
            '/(?:[a-z]|_)[a-z0-9_]*(?=[ \t]*\()/i',
            'sh_function',
            -1
        ),
        array(
            '/([a-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[a-z][^`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?\'\\\\[\]\^\-\[\]]+))/i',
            array('sh_usertype', 'sh_usertype', 'sh_normal'),
            -1
        )
    )
);
